package com.example.score.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ExamDetailDTO {
    @JsonProperty("exam_id")
    private Long examId;

    @JsonProperty("subject_id")
    private Long subjectId;

    @JsonProperty("subject_name")
    private String subjectName;

    @JsonProperty("class_id")
    private Long classId;

    @JsonProperty("class_name")
    private String className;

    private Integer status;

    private List<StudentDTO> students;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class StudentDTO {
        @JsonProperty("student_id")
        private Long studentId;

        @JsonProperty("student_oms_id")
        private Long studentOmsId;

        @JsonProperty("student_num")
        private String studentNum;

        @JsonProperty("student_name")
        private String studentName;

        @JsonProperty("submit_status")
        private Integer submitStatus;

        @JsonProperty("paper_images")
        private List<PaperImage> paperImages;

        @JsonProperty("ques_infos")
        private List<QuestionScoreDTO> quesInfos;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class QuestionScoreDTO {
        @JsonProperty("question_id")
        private Long questionId;
        private Double score;
        @JsonProperty("is_right")
        private Integer isRight;
        @JsonProperty("student_answer")
        private String studentAnswer;

    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class PaperImage {
        @JsonProperty("image_path")
        private String imagePath;

        @JsonProperty("image_page")
        private Integer imagePage;

    }
} 